-- @author lixiyong01
-- @date 2023.02.24
-- 进行OLAP层分析提存处理

use hdp_lbg_supin_zplisting;

insert overwrite table app_zp_wb_n_flow partition(dt='${dateSuffix}')
select
    stime,
    sid,
    pid,
    platform,
    requesttype,
    '' as requesttype_name,
    slot,
    '' as slot_name,
    source1,
    source2,
    source3,
    logintag,
    userid,
    ukey,
    cookieid,
    imei,
    resumeid,
    info_id,
    info_buid,
    info_buid_type,
    info_etpid,
    '' as info_etpname,
    info_title,
    info_cate1,
    info_cate2,
    info_cate3,
    '' as info_cate2_name,
    '' as info_cate3_name,
    info_local1,
    info_local2,
    info_local3,
    '' as info_local1,
    '' as info_local2,
    info_type,
    concat_ws(',',info_types) as info_types2,
    page_no,
    page_pos,
    has_exposure,
    0 as exposure_cnt,
    '' as exposure_times2,
    has_infodetail,
    info_detail_cnt,
    has_im,
    bc_type,
    has_ack,
    has_read,
    has_reply,
    has_delivery,
    delivery_cnt,
    has_tel,
    tel_cnt,
    tel_conn_cnt,
    0 as tel_conn_times2,
    has_yx,
    yx_cost,
    yx_cash,
    has_jz,
    jz_cost,
    jz_cash
from hdp_lbg_supin_zplisting.dm_zp_wb_n_flow a
where dt='${#date(0,0,-1):yyyyMMdd#}'
    and blackiptag=0
    and spidertag=0
    and (has_exposure+has_infodetail+has_im+has_tel+has_delivery)>0;

